home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 October / EnigmA AMIGA RUN 22 (1997)(G.R. Edizioni)(IT)[!][issue 1997-10 & 11][EAR-CD VI].iso / progs / devel / pcq12d_1 / docs / pcq.doc < prev    next >
Text File  |  1992-08-16  |  34KB  |  918 lines

  1.  
  2.  
  3.  
  4.                        The PCQ Make Utility
  5.  
  6.  
  7.  
  8. PCQ is a program that automates the compilation process by running
  9. the compiler, optimizer, assembler and linker on the file you
  10. specify.  You can use PCQ with a command line as simple as "PCQ
  11. ProgramName", but since there are so many system organizations to
  12. consider, PCQ accepts all sorts of configuration options.
  13.  
  14. PCQ is only available to registered users of PCQ Pascal, so it
  15. should not be distributed.  The program and this documentation is:
  16.  
  17.         Copyright (c) 1991 by Patrick Quaid.
  18.         All Rights Reserved.
  19.  
  20.  
  21.  
  22.  
  23.  Installation
  24. --------------
  25.  
  26. To use PCQ, you must first copy it to somewhere on your command
  27. path (i.e.  the series of directories used with the AmigaDOS PATH
  28. command, or just C: and the current directory if you don't use
  29. the PATH command).  In most cases you should just copy it to the
  30. C: directory.
  31.  
  32.  
  33.  
  34.  Configuring PCQ
  35. -----------------
  36.  
  37. When PCQ starts up, it does the following:
  38.  
  39.         1.  Processes the configuration file in the S: directory,
  40.             if it exists.
  41.         2.  Processes the configuration file in the current
  42.             directory, if it exists.
  43.         3.  Processes all the command line arguments, from left
  44.             to right.
  45.  
  46. The configuration files are always named PCQ.CFG, and as indicated
  47. above you can have up to two of them.  I normally use S:PCQ.CFG to
  48. store the default values I always use, then set any specific
  49. options using a PCQ.CFG file in each directory.
  50.  
  51. The configuration files are normal text files in which each line
  52. is a command for PCQ.  Most of the commands just set the options
  53. you will use, and they are all described below.  Blank lines and
  54. lines beginning with an asterisk (*) are ignored.
  55.  
  56. The command line arguments can include any of the configuration
  57. commands, but can also specify files.  What PCQ does with each
  58. file you specify depends on its suffix:  if it thinks it's a
  59. Pascal source file, for example, it compiles, assembles and links
  60. it.  There are four types of files that PCQ recognizes:  Pascal
  61. source code, Assembly source code, Object code, and Project files.
  62. The suffixes used to identify these files are by default .p, .asm,
  63. .o and .project, but you can set them to whatever you like.
  64.  
  65. You know what the first three files are, but projects are new.  A
  66. project file defines a group of files that make up a single
  67. program.  The format of a project file is the same as a
  68. configuration file, and it can use all the same commands to set up
  69. specific options.  In addition to these configuration commands,
  70. however, there are also some commands that specify which files
  71. should be included with the final program.  Project files are
  72. explained below.  For now, let's take a look at the available
  73. configuration commands.
  74.  
  75.  
  76.  PCQ Commands
  77. --------------
  78.  
  79. The commands accepted by PCQ come in two broad categories.  The
  80. first are switch commands, which turn options on and off.  These
  81. are preceded by a plus (+) or minus (-) sign to indicate the state
  82. you want.  For example, to turn on range checking, you would
  83. include the following command in you configuration file:
  84.  
  85.                 +Range
  86.  
  87. Many of the switches have single-character synonyms to make them
  88. easier to include on the command line.  The second type of
  89. configuration command is a string definition.  To set the
  90. destination directory, for example, you would issue the following
  91. command:
  92.  
  93.                 Destination Work:Pascal
  94.  
  95. Some of these string definition commands define lists of strings.
  96. For example, you can define any number of suffixes that PCQ will
  97. recognize for a given file type.  You issue the command just like
  98. a normal string definition, but instead of replacing the previous
  99. value, PCQ adds it to the list.  For these types of commands, if
  100. you don't include a string in the command, the list is cleared.
  101.  
  102. PCQ commands can be entered in any case.  They include the
  103. following:
  104.  
  105.  
  106.  
  107.                           Assemble or A
  108.  
  109. This switch determines whether PCQ will assemble the file produced
  110. by the compiler.  If you specify -Assemble or -A, PCQ will leave
  111. an assembly language file in the destination directory.
  112. Otherwise, it will assemble the file and delete the intermediate
  113. assembly file.  The default value for this option is +A, which
  114. causes PCQ to assemble the file normally.
  115.  
  116.  
  117.                             Assembler
  118.  
  119. This command lets you specify the command path for the assembler.
  120. The string following the command can directory and volume
  121. information as necessary.  The default value for this option is
  122. "A68k".
  123.  
  124.  
  125.                          AssemblerError
  126.  
  127. The AssemblerError command defines the string that PCQ executes if
  128. there are any errors during assembly.  The command string can
  129. contain the special character sequences /s, /d and /e, which will
  130. be replaced by the source, destination and error file names before
  131. the string is executed.
  132.  
  133. The default value for this option is "AssemErrors /s /e", which
  134. calls a batch file that invokes an editor to display the source
  135. file and the error text, then deletes the error text.  You should
  136. modify this batch file to fit with your system, and be sure to set
  137. the file's script bit using the AmigaDOS command "Protect
  138. AssemErrors +s".
  139.  
  140.  
  141.                             Assembly
  142.  
  143. This command defines the suffixes that PCQ will use to recognize
  144. assembly language files.  You can specify any number of suffixes,
  145. and if any of them match a file's suffix the file will be
  146. considered an assembly language source file.  When PCQ creates an
  147. assembly language file, it uses the most recently defined assembly
  148. suffix.  To clear all the assembly suffixes, just use the Assembly
  149. command with a blank suffix.
  150.  
  151.  
  152.                            CCalls or C
  153.  
  154. The CCalls switch determines whether PCQ Pascal uses normal Pascal
  155. calling conventions or those of C.  In the default -C state, PCQ
  156. Pascal passes parameters to procedures and functions by pushing
  157. them on the stack from left to right.  In the +C state, PCQ Pascal
  158. pushes parameters from right to left, just like C compilers.  If
  159. you are using unnamed parameters, you'll need to use the +C
  160. option.
  161.  
  162.  
  163.                           CheckIO or I
  164.  
  165. The CheckIO switch determines whether PCQ Pascal will insert
  166. instructions to automatically check the IO status after every IO
  167. command.  It corresponds to the $I compiler directive, so +I
  168. specifies automatic IO checking and -I specifies manual checking.
  169.  
  170.  
  171.                             Compiler
  172.  
  173. This command sets the command string used to invoke the compiler.
  174. It can include any directories and volume names that are
  175. necessary, and the default value is "Pascal".
  176.  
  177.  
  178.                           CompilerError
  179.  
  180. The CompilerError command defines a command template to be used
  181. whenever the compiler finds errors in a Pascal source file.  The
  182. command defined here is executed by PCQ, which then quits.  In the
  183. command template you can use several special character sequences.
  184. The first is \s, which PCQ will replace with the source file name
  185. before executing the command.  The next is \e, which PCQ will
  186. replace with the name of a file that contains the error text
  187. produced by the compiler.  The last one is \d, which is replaced
  188. by the name of the assembly language file that the compiler was
  189. creating.
  190.  
  191. The default value for this option is "CompErrors \s \d \e", which
  192. invokes a batch file called CompilerError that is included with
  193. PCQ.  This batch file, in turn, simply invokes an editor to
  194. display the program and error files, then deletes the error file
  195. and the compiler output file.  For users with Arexx and CygnusEd
  196. Professional, there is an alternative Arexx program that invokes
  197. the editor with the source file, then displays each error in turn.
  198. You should modify the CompilerError batch file to do something
  199. convenient on your system, and be sure that the script bit of the
  200. batch file is set (using an AmigaDOS command like "Protect
  201. CompErrors +s").
  202.  
  203.  
  204.                            Debug or D
  205.  
  206. The Debug switch determines whether the assembler should include
  207. debugging information (the assembly language symbol table,
  208. actually) in an object file.  It corresponds to A68k's -d switch.
  209. The default is -Debug, so no debugging information is included.
  210.  
  211. Keep in mind that this command puts the debugging information in
  212. the object file only.  If you want it to make it through to the
  213. executable file, you'll also need to specify -NoDebug (see below).
  214.  
  215.  
  216.                            Destination
  217.  
  218. The Destination command defines the directory in which PCQ should
  219. place its final files, whether those files are executable
  220. programs, object files, assembly files, or whatever.  The default
  221. value is blank, so PCQ stores finished products in the current
  222. directory.  If you specify a non-blank destination directory that
  223. does not end with a colon or slash, PCQ will append a slash for
  224. you.
  225.  
  226.  
  227.                            Discard or X
  228.  
  229. The Discard switch lets you ignore the results of functions so
  230. they can be called just like procedures.  In the normal -X state,
  231. you can only call functions from within expressions.  In the +X
  232. state, you can also call functions as simple statements, exactly
  233. how you would call a procedure.
  234.  
  235.  
  236.                             Force or F
  237.  
  238. The Force switch tells PCQ to compile Pascal and assembly source
  239. files even if a more recent object file exists.  In the default -F
  240. state, PCQ will skip files for which a more recent object file
  241. exists, unless the command to process the file was received on the
  242. command line.  In the +F state, all source files are compiled or
  243. assembled.
  244.  
  245.  
  246.                               Exec
  247.  
  248. The Exec command specifies the name of the executable file that
  249. should be produced for a project.  This command is only valid in
  250. project files, and it can only be used once per project.  If you
  251. do not include an Exec name in a project file, the executable
  252. program will take the name of the main file, with the suffix
  253. stripped off.  If the Exec name does not include a directory, it
  254. is placed in the destination directory.
  255.  
  256.  
  257.                              Execute
  258.  
  259. The Execute command issues the string you give it as an AmigaDOS
  260. command.  It does not modify the string at all.
  261.  
  262.  
  263.                             External
  264.  
  265. The External command specifies that the given file should be
  266. compiled and/or assembled, and eventually linked with the rest of
  267. the files in a project.  If there is already an object file that
  268. is more recent than the source file, the file is not compiled or
  269. assembled but is still included on the list.
  270.  
  271. To determine the object file name, PCQ takes the source file name
  272. and strips off the directories and the suffix.  It then appends
  273. the most recently defined object file suffix, and looks for that
  274. file in the destination directory.
  275.  
  276. The External command can only be used in project files, but you
  277. can (and typically will) have several for each project.  Also note
  278. that the external file can be a Pascal source, an Assembly source,
  279. or even an object file.  In the last case, the file is just
  280. included on the external file list.
  281.  
  282.  
  283.                              Library
  284.  
  285. The Library command adds an object code library to the list of
  286. libraries that will be sent to the linker.  You can have any
  287. number of library files, and they will all be used in the linker
  288. command with the most recently added library first.  If you use
  289. the Library command without a file name, the list is cleared of
  290. all libraries.  The default library list is the single file
  291. "PCQ.lib".
  292.  
  293. If you are using Matt Dillon's Dlink as your linker you should be
  294. sure that all of your libraries end with .lib or .l, or there
  295. could be conflicts between the libraries and object files.
  296.  
  297.  
  298.                             Link or L
  299.  
  300. The Link switch determines whether PCQ should link object files.
  301. If you specify -L, PCQ will leave an object file in the
  302. destination directory instead of an executable program.  The
  303. default is +L, which makes PCQ link programs normally.
  304.  
  305.  
  306.                              Linker
  307.  
  308. The Linker command specifies the command that will be used to
  309. invoke the linker.  This can include directories and volume names
  310. as necessary.  The default value is "Blink".
  311.  
  312.  
  313.                            LinkerError
  314.  
  315. This command specifies the command that PCQ will execute if the
  316. linker reports any errors.  The command can include the special
  317. character sequences /s, /d and /e, which will be replaced with the
  318. source, destination and error file names, respectively.  The
  319. default value is "LinkErrors /e", which calls the batch file
  320. LinkerError that is included with PCQ.  The batch file just
  321. invokes an editor to display the error file, then erases the error
  322. file.  You should modify this batch file to match your system, and
  323. be sure to set the script bit using the AmigaDOS command "Protect
  324. LinkErrors +s".
  325.  
  326. Note that in the case of project files, the source file name will
  327. be the main object file, although the error could have been caused
  328. by any of the external files or libraries.
  329.  
  330.  
  331.                             LinkForm
  332.  
  333. The LinkForm command determines which format will be used for the
  334. linker command line.  You should follow the LinkForm command with
  335. either Alink, Blink or Dlink, depending on the linker you use (you
  336. can shorten it to just the first letter, if you prefer).  The
  337. default value is Blink.
  338.  
  339.  
  340.                               Main
  341.  
  342. The Main command specifies the main program file of a project.  If
  343. the file specified is more recent than its corresponding object
  344. file, it is compiled and/or assembled as necessary.  This command
  345. can only be used in project files, and can only be used once per
  346. project.  It must be used once, however, so that PCQ knows which
  347. file should be listed first in the linker command line.
  348.  
  349. The corresponding object file name is created by stripping the
  350. directories and suffix from the program name, and adding the most
  351. recently defined object file suffix.  PCQ looks for the file in
  352. the destination directory.
  353.  
  354. Note that, like External file names, the Main program can be a
  355. Pascal source, an Assembly source, or even an object file.
  356.  
  357.  
  358.                                Map
  359.  
  360. The Map command is different in that it is both a switch and a
  361. string definition command.  If you specify +Map, the linker will
  362. generate a map file.  If you include a file name after the +Map
  363. command, the linker will use that name for the map file.  If you
  364. do not specify a name, PCQ uses the name of the main file,
  365. stripped of directories and suffixes, and adds the suffix ".MAP".
  366.  
  367. If you use -Map to specify that a map file should not be
  368. generated, any file name included after the command will be
  369. ignored.
  370.  
  371. Note that only Alink and Blink can generate map files.
  372.  
  373.  
  374.                             MapOptions
  375.  
  376. The MapOptions command specifies the map parameters that PCQ
  377. should pass on to Blink, the only linker that will accept them.
  378. PCQ passes the entire string you enter here, which can contain one
  379. or more of the following:
  380.  
  381.         H for a hunk map
  382.         S for a symbol map
  383.         X for a cross-reference in the map file
  384.         F for a file map
  385.         O for an overlay map
  386.         FANCY to include printer control codes
  387.         PLAIN to suppress the printer control codes
  388.  
  389. The default value for MapOptions is "S PLAIN".
  390.  
  391.  
  392.                          MathTrans or N
  393.  
  394. The MathTrans switch determines whether PCQ should use the
  395. mathtrans.library or its own internal routines for trigonometric
  396. and exponential functions.  It corresponds to the $N compiler
  397. directive.  If you use the +N option, the program will attempt to
  398. open the mathtrans.library, which must therefore be in the LIBS:
  399. directory.  If you use the -N option, the default, PCQ will use
  400. internal routines so that mathtrans.library is not required.
  401.  
  402.  
  403.                              NoDebug
  404.  
  405. The NoDebug switch determines whether PCQ issues the linker command
  406. NODEBUG, which strips any debugging information from object files
  407. before it links them.  The +NoDebug option, the default, ensures
  408. that any debugging information in object libraries will not be
  409. included in the executable.  The -NoDebug option passes any
  410. existing debug information through to the executable, where it can
  411. be accessed by debuggers and disassemblers.
  412.  
  413. Incidentally, the debugging information is only included in the
  414. object files if you specify +Debug (see above for more information
  415. on Debug).
  416.  
  417.  
  418.                              Object
  419.  
  420. The Object command adds to the list of suffixes that will identify
  421. object code files.  If you do not specify a suffix, the entire list
  422. is cleared.  The default object file suffix list consists of the
  423. single element ".o".
  424.  
  425.  
  426.                           Optimize or O
  427.  
  428. This switch determines whether PCQ should run the output of the
  429. compiler through the peephole optimizer before it passes it on to
  430. the assembler.  In the default case +O, the optimizer is used.  If
  431. you specify -O, the optimization step is skipped.
  432.  
  433.  
  434.                             Optimizer
  435.  
  436. This command defines the command string that PCQ will use to invoke
  437. the peephole optimizer.  It can include directories and volume
  438. names as necessary.  The default optimizer command is "Peep".
  439.  
  440.  
  441.                          OptimizerError
  442.  
  443. The OptimizerError command defines the command that PCQ issues when
  444. there are errors during the optimization process.  The command can
  445. include the special character sequences /s, /d and /e, which will
  446. be replaced by the source file name, the destination file name, and
  447. a file containing the error text, respectively.  The default value
  448. for this option is "OptErrors /s /d /e".  The file
  449. OptimizerError is a batch file included with PCQ that invokes the
  450. editor to display the source and error files, then erases the
  451. destination and error files.  You should be sure to modify this
  452. file to call the editor you use, and remember to set the file's
  453. script bit using the command "Protect OptErrors +s".
  454.  
  455.  
  456.                              Pascal
  457.  
  458. The Pascal command adds a suffix to the list of strings that will
  459. identify Pascal source code files.  If you do not specify a suffix,
  460. the list will be cleared.  The default Pascal source code suffix is
  461. ".p".
  462.  
  463.  
  464.                           Profiler or P
  465.  
  466. The Profiler switch determines whether PCQ Pascal adds execution
  467. profiler information to programs it compiles.  It corresponds to
  468. PCQ Pascal's -p command line switch.  The default state is -P,
  469. which omits the execution profiler code.  If you use the +P option,
  470. the profiler code will be added.
  471.  
  472.  
  473.                              Project
  474.  
  475. The Project command adds to the list of suffixes that will identify
  476. project files.  If you do not specify a suffix after the Project
  477. command, the list is cleared.  The default Project file suffix is
  478. ".project".
  479.  
  480.  
  481.                            Range or R
  482.  
  483. The Range switch determines whether PCQ Pascal adds code to a
  484. program to ensure that array indexes fall within their specified
  485. range.  It corresponds to the $R compiler directive.  If you
  486. specify +R, the compiler will add the extra code, which will slow
  487. the program down.  If you specify -R, the default, the range
  488. checking code is omitted.
  489.  
  490.  
  491.                         ShortCircuit or B
  492.  
  493. The ShortCircuit switch determines whether PCQ Pascal will use
  494. short circuit Boolean evaluations.  It corresponds to the compiler
  495. directive $B, so using +B allows short circuit evaluations to be
  496. used whenever possible, and -B ensures that all expressions will be
  497. fully evaluated.  The default value is +B.
  498.  
  499.  
  500.                             SmallCode
  501.  
  502. The SmallCode switch determines whether the linker should combine
  503. all code sections into one big section.  It corresponds to Alink
  504. and Blink's SMALLCODE option.  Dlink combines all code sections by
  505. default, so not specifying SmallCode makes PCQ use Dlink's -f
  506. (fragment) option.  The default value is -SmallCode, which means
  507. that only sections with the same name and type are combined.
  508.  
  509.  
  510.                             SmallData
  511.  
  512. The SmallData switch determines whether the linker should combine
  513. all data sections into one big section.  It corresponds to Alink
  514. and Blink's SMALLDATA option.  Dlink combines all data sections by
  515. default, so specifying -SmallData causes PCQ to use Dlink's -f
  516. (fragment) option.  The default value is -SmallData, which means
  517. that only sections with the same name and type are combined.
  518.  
  519.  
  520.                          SmallInit or S
  521.  
  522. The SmallInit switch determines whether the program should use the
  523. normal startup code, or a minimal startup code that is much smaller
  524. but does not support any IO statements.  It corresponds to the
  525. compiler's -s command line switch.  The default value is -S, which
  526. causes PCQ to use the normal startup code.
  527.  
  528.  
  529.                              Source
  530.  
  531. The Source command tells PCQ where it should search for Pascal,
  532. Assembly or Object files that can't be found in the current
  533. directory.  The default value is blank, which means that only the
  534. current directory is searched.  If you specify a non-blank value
  535. that does not end in a colon or slash, PCQ will append a slash.
  536.  
  537.  
  538.                               Temp
  539.  
  540. The Temp command defines the directory in which all temporary files
  541. should be created.  Normally this directory should be located on
  542. the RAM: disk to speed up the compilation process, but for large
  543. programs on small systems you can specify any directory.  The
  544. default value is "T:".  If you specify a non-blank value that does
  545. not end in a colon or slash, PCQ will append a slash.
  546.  
  547.  
  548.                           Verbose or V
  549.  
  550. This switch determines whether PCQ will write progress messages. 
  551. The default value is +V, which causes PCQ to print each of the
  552. commands as it executes.  If you specify -V, PCQ will not print any
  553. messages unless an error occurs.
  554.  
  555.  
  556.                                Xref
  557.  
  558. The Xref command is similar to the Map command in that it is both
  559. a switch and a string definition.  If you precede Xref with a plus
  560. sign, PCQ will generate a cross-reference file.  If you specify a
  561. file name afterward PCQ will use that file.  Otherwise, it will
  562. create a file using the main file name with the directory and
  563. suffix stripped off and the suffix ".XREF" added.  It will be
  564. created in the destination directory.  If you precede Xref with a
  565. minus sign, any file name you specify will be ignored.
  566.  
  567. Note that only Alink and Blink can generate cross-reference
  568. reports.  Also note that Blink can include the cross-reference
  569. report in a MAP file if you include the MapOption X.
  570.  
  571.  
  572.  
  573.  
  574.  Project Files
  575. ---------------
  576.  
  577. One of the handiest features of PCQ is that it can completely
  578. automate the compilation of even complex programs.  In order to do
  579. that, you need to create a project file for the program.  Project
  580. files use all the same commands as configuration files, plus a few
  581. special ones.  As an example, the project file I use for the
  582. compiler itself looks like this:
  583.  
  584.         Main     Main.p
  585.         External Calls.p
  586.         External Declarations.p
  587.         External Evaluate.p
  588.         External Expr.p
  589.         External Initialize.p
  590.         External IO.p
  591.         External Optimize.p
  592.         External StanProcs.p
  593.         External Utilities.p
  594.         External Statements.p
  595.         Exec     Pascal2
  596.  
  597. The Main command defines the file that will be included first in
  598. the linker command line.  The rest of the files are normally
  599. external files.  The External command defines each of the external
  600. files that make up the program, which will all be linked into the
  601. final executable.  The Exec command sets the name of that
  602. executable program, and is optional.  If it wasn't included in
  603. this case, the executable program would be called Main (because
  604. the file defined with the Main command is called Main.p).
  605.  
  606. Each of the Main and External files is compiled when the command
  607. is processed, unless an object file exists with the same name and
  608. a later creation date and time.  The object files will be created
  609. with the same name as the source file, with any directory and
  610. suffixes stripped off, in the destination directory.
  611.  
  612. Any configuration commands placed in the project file apply only
  613. to the files that follow it.  Thus in the following example:
  614.  
  615.         Main     Program.p
  616.         +Range
  617.         External Ext1.p
  618.         External Ext2.p
  619.         -Range
  620.         External Ext3.p
  621.  
  622. Only the files Ext1.p and Ext2.p will be compiled with range
  623. checking turned on.  On the other hand, the Main, External and
  624. Exec commands do not have to be in any particular order (i.e. the
  625. Main command doesn't have to be first).
  626.  
  627.  
  628.  Command Line Parameters
  629. -------------------------
  630.  
  631. After reading the configuration files, PCQ begins processing the
  632. command line arguments.  These arguments can be any of the normal
  633. configuration commands, or they can be files to be processed.  If
  634. the argument is a configuration command, it should always be
  635. preceded by a plus or minus sign, even for commands that don't use
  636. one (PCQ will just ignore the + or - if it doesn't apply).  For
  637. commands that will include spaces, like the string definition
  638. commands, you can enclose the argument in double quotes.  For
  639. example:
  640.  
  641.         PCQ "+Destination Work:Pascal" +r file.p
  642.  
  643. This command changes the destination directory, turns range
  644. checking on, then compiles "file.p".
  645.  
  646. If an argument is not preceded by a plus or minus sign, PCQ
  647. assumes that it is a file to be processed.  PCQ first checks to
  648. see if the file includes any of the project suffixes.  If it does,
  649. then it is processed as a project.
  650.  
  651. If it doesn't, PCQ then checks for a Pascal suffix.  If it finds
  652. one, it compiles, optimizes, assembles and links the file (unless
  653. you have turned one or more of those steps off).  The executable
  654. file, if there are no errors, will have the name of the source
  655. file with the extension stripped off, and will be placed in the
  656. destination directory.
  657.  
  658. If it didn't have a Pascal suffix, PCQ then checks for an assembly
  659. suffix.  If it has one, PCQ assembles and links the file (again
  660. assuming you haven't turned either step off).  The executable file
  661. will be formed in the same way as the Pascal file.
  662.  
  663. If none of the previous suffixes apply, PCQ checks for an object
  664. code suffix.  If it finds one it links the file, with an
  665. executable name again formed the same way.
  666.  
  667. If none of these suffixes match, PCQ appends the project suffixes
  668. to the file name and looks for a file of that name.  If it finds
  669. one, it processes it as a project file.  If it doesn't find one,
  670. it tries the same thing with all the other suffixes.  If none of
  671. them match, PCQ issues an error.
  672.  
  673.  
  674.  Error Handlers
  675. ----------------
  676.  
  677. Integrated programming environments tend to have built-in editors,
  678. and I considered adding one to PCQ.  The problem is that I
  679. couldn't hope to write an editor better than the one I normally
  680. use, so I for one wouldn't want to use the simpler one.  Instead
  681. of including an editor I have made "hooks" in PCQ to let you use
  682. your favorite editor to automatically edit files when there is an
  683. error.
  684.  
  685. To see how these hooks work, let's use an example in which we are
  686. trying to compile a program called Test.p that contains errors.
  687. When PCQ tries to compile the program it notices the errors, and
  688. it looks at the definition of CompilerError to see what should be
  689. done.  In this case we'll assume that CompilerError still has the
  690. default definition, which is:
  691.  
  692.         CompErrors \s \d \e
  693.  
  694. The first thing that PCQ does is replace the special sequences
  695. beginning with the backslash.  The sequence \s is replaced by the
  696. name of the source file we were trying to compile, which in this
  697. case is Test.p.  PCQ then substitutes the name of the output
  698. assembly language file the compiler was creating for the sequence
  699. \d.  In some cases this file will be in the destination directory,
  700. but more often it will be an oddly named file in the temporary
  701. directory.  Finally, PCQ replaces the sequence \e with the name of
  702. a file that contains the error report from the compiler.  This
  703. will always be a file in the temporary directory.  For our
  704. example, PCQ creates the following command string:
  705.  
  706.         CompErrors Test.p T:PCQ_Temp.asm T:PCQ_Temp0
  707.  
  708. This command is passed along to AmigaDOS, which tries to invoke a
  709. program called CompErrors.  In this case the program is a batch
  710. file that is included with PCQ.  The batch program invokes an
  711. editor to display the source and error files, then deletes the
  712. output and error files.  It looks like this:
  713.  
  714.                 .key source,dest,error
  715.                 Ed <source> <error>
  716.                 Delete <dest>
  717.                 Delete <error>
  718.  
  719. If your editor isn't called Ed, or if it can't handle two files at
  720. once, you'll have to modify the batch file.  If you have a more
  721. powerful editor and/or Arexx, you can do much more interesting
  722. things.  I have included several error handlers for users with
  723. Arexx, and either CygnusEd Professional, DME, or QED.  For
  724. example, I use CygnusEd Professional with Arexx, and I've set my
  725. CompilerError string as follows:
  726.  
  727.         rx CED-ShowError \s \d \e
  728.  
  729. If you have AmigaDOS 2.0 you don't need to include the rx command.
  730. CED-ShowError, which along with several variations for different
  731. editors is included with PCQ, takes the following steps:
  732.  
  733.         1. Ensures that CED and the source file are both loaded.
  734.         2. Moves to the first error position.
  735.         3. Displays the error message.
  736.         4. Deletes the output and error files.
  737.  
  738. The error handlers for optimizer, assembler, and linker errors
  739. work the same way as the one for compiler errors.  Since I assume
  740. that you'll be using PCQ mainly to compile Pascal programs, I
  741. have only included good handlers for compiler errors.  If you plan
  742. to do a lot of assembly work you might consider writing a handler
  743. to parse A68k's error messages.
  744.  
  745. Keep in mind that the string you specify as the CompilerError is
  746. simply executed by AmigaDOS, so it can be any command that
  747. AmigaDOS understands.  It does not have to be a batch file.
  748.  
  749.  
  750.  
  751.  
  752.  Using PCQ with CygnusEd Professional and Arexx
  753. ------------------------------------------------
  754.  
  755. If you use CygnusEd Professional, you need to copy CED-ShowError
  756. to your Rexx:  directory and include the following line in your
  757. PCQ.CFG file:
  758.  
  759.     CompilerError rx CED-ShowError \s \d \e
  760.  
  761.  
  762.  
  763.  Using PCQ with DME and Arexx
  764. ------------------------------
  765.  
  766. If you use DME and Arexx, you need to copy the file DME-Error to
  767. any of your path directories (I would recommend S:), then copy
  768. DME-ShowError to your Rexx:  directory.  You then need to add the
  769. following line to your PCQ.CFG file:
  770.  
  771.     CompilerError DME-Error \s \d \e
  772.  
  773. Finally, you'll need to include the following line in your .EDRC
  774. file (that's the DME configuration file):
  775.  
  776.     rx DME-ShowError
  777.  
  778. If you include the complete path for DME-ShowError, it does not
  779. have to be in your Rexx:  directory.  Every time DME starts up, it
  780. will run DME-ShowError, but the Arexx program will return
  781. immediately if DME was not invoked through PCQ.
  782.  
  783.  
  784.  
  785.  Using PCQ with QED and Arexx
  786. ------------------------------
  787.  
  788. If you use QED, you need to include the Arexx program
  789. QED-ShowError in your Rexx:  directory, then add the following
  790. line to your PCQ.CFG file:
  791.  
  792.     CompilerError rx QED-ShowError \s \d \e
  793.  
  794. Again, if you include the complete path for QED-ShowError it
  795. doesn't have to be in your Rexx:  directory.
  796.  
  797.  
  798.  
  799.  Using PCQ with MEMACS and Arexx
  800. ---------------------------------
  801.  
  802. If you use MEMACS, one of the text editors Commodore supplies with
  803. AmigaDOS, and Arexx, you can use the following set-up.  Copy the
  804. file MEMACS-ShowError to your Rexx:  directory, then add the
  805. following line to your PCQ.CFG file:
  806.  
  807.     CompilerError rx MEMACS-ShowError \s \d \e
  808.  
  809. Then, in your S:Emacs_pro file (that's the MEMACS configuration
  810. file, by the way), include the following as the last line:
  811.  
  812.     execute-file S:PCQ-Error
  813.  
  814. Finally, you need to create a dummy S:PCQ-Error file that will be
  815. replaced, when appropriate, by a series of commands to display
  816. errors.  I suggest creating an S:PCQ-Error file with the following
  817. contents:
  818.  
  819.     show-line#
  820.  
  821.  
  822.  
  823.  Using PCQ with MicroEMACS
  824. ---------------------------
  825.  
  826. If you use Daniel Lawrence's MicroEMACS, you don't even need
  827. Arexx.  Just attach the file EMACS.errors on to your EMACS.RC file
  828. (the MicroEMACS configuration file), and add the following line to
  829. your PCQ.CFG file:
  830.  
  831.     CompilerError EMACS-ShowError \s \d \e
  832.  
  833. EMACS-ShowError is just an AmigaDOS batch file that takes creates
  834. the error file that MicroEMACS expects, runs MicroEMACS, and
  835. deletes the temporary files.
  836.  
  837. The other error handlers just display the first error.  This one,
  838. on the other hand, begins with the cursor on the first error.  If
  839. you press Shift-F9, it moves the cursor to the next error.  If
  840. there are no more errors, it will display the message "No more
  841. errors".  Note that if you make changes to the source file,
  842. especially if you add or delete lines, subsequent error messages
  843. will be misplaced.
  844.  
  845.  
  846.  
  847.  Using PCQ with other editors
  848. ------------------------------
  849.  
  850. It should be very easy to convert the various ShowError files to
  851. work with UEdit with or without Arexx, but since I don't have
  852. the registered version and I'm not familiar with the unregistered
  853. version, I couldn't seem to make it work.
  854.  
  855. Similarly, since TextEd supports Arexx it should be a simple task
  856. to convert one of the programs, but I don't know TextEd's Arexx
  857. command set.
  858.  
  859. If you are using an editor that will not edit two files at once
  860. (like AmigaDOS's ED), you might try the following CompErrors file:
  861.  
  862.     .key source,dest,error
  863.     type <error>
  864.     Ed <source>
  865.     delete <dest>
  866.     delete <error>
  867.  
  868. That batch file just writes the errors to the CLI, then calls your
  869. editor.  It's not very useful, but then neither is ED.
  870.  
  871.  
  872.  
  873.  
  874.  Update History
  875. ----------------
  876.  
  877. Version 1.02 (September 18, 1991)
  878.  
  879.   Enhancements:
  880.     o  Added the Discard and CCalls switches
  881.  
  882.  
  883. Version 1.01 (September 8, 1991)
  884.  
  885.   Bug fixes:
  886.     o  Fixed an Enforcer hit caused by uninitialized Main_name
  887.  
  888.   Enhancements:
  889.     o  Added the Force switch.
  890.  
  891.  
  892. Version 1.0 (August 10, 1991)
  893.  
  894.     Initial release
  895.  
  896.  
  897.  
  898.  Contacting the Author
  899. -----------------------
  900.  
  901. I can be reached at the following address:
  902.  
  903.  
  904.         Patrick Quaid
  905.         2250 Clarendon Blvd, Apt #1209
  906.         Arlington, VA 22201
  907.         USA
  908.  
  909. I can also be reached by phone (voice) at: (703) 524-8945
  910.  
  911. Please note that my address and phone number have changed
  912. since April '92.
  913.  
  914. If you have any problems with PCQ or the rest of the PCQ Pascal
  915. system, please let me know.
  916.  
  917.  
  918.